#
# Cookbook Name:: zol
# Recipe:: packages
#
# Copyright 2013, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#


# Install ZFS On Linux 

if platform?("redhat", "centos", "scientific", "amazon") and node.platform_version.to_f >= 6.0
    execute "Install ZFS On Linux EL Repository" do
        command "yum localinstall -y --nogpgcheck http://archive.zfsonlinux.org/epel/zfs-release-1-2.el6.noarch.rpm"
        not_if "rpm -q zfs-release > /dev/null 2>&1"
    end

    # Then install ZFS with all deps - DKMS 
    # TODO: Add DKMS Check and update
    %w{ zfs }.each do |pkg|
        package pkg do
            action :install
        end
    end
end
